#!/usr/bin/env python
#coding:utf-8
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write('<html><body><form action="/" method="post">'
                   '<input type="text" name="message">'
                   '<input type="submit" value="Submit">'
                   '</form></body></html>'
        )
    # def post(self):
    #     self.set_header("Content-Type","test/plain")
    #     self.write("you wrote"+self.get.argument("message"))

application = tornado.web.Application([
        (r"/", MainHandler),
])
if __name__ == "__main__":
    application.listen(8800)
    tornado.ioloop.IOLoop.instance().start()
